<div class="left-main" style="height: calc(100% - 40px);">
	<el-scrollbar @scroll="DocumentHideAllPop">
		<ul class="el-menu el-menu--vertical">
			<li 
				class="el-menu-item" 
				:class="{'is-active':LeftCurrenType==''}"
				@click="LeftClick('')">
				<el-icon class="icon"><Message-Box /></el-icon>
				<el-text>全部</el-text>
				<span class="num">{{LeftTreeSidebar.all}}</span>
			</li>
			<li 
				class="el-menu-item" 
				:class="{'is-active':LeftCurrenType=='notclassify'}"
				@click="LeftClick('notclassify')">
				<el-icon class="icon"><Discount /></el-icon>
				<el-text>未分类</el-text>
				<span class="num">{{LeftTreeSidebar.nocat}}</span>
			</li>
			<li 
				class="el-menu-item" 
				:class="{'is-active':LeftCurrenType=='nottag'}"
				@click="LeftClick('nottag')">
				<el-icon class="icon"><Price-Tag /></el-icon>
				<el-text>未标签</el-text>
				<span class="num">{{LeftTreeSidebar.notag}}</span>
			</li>
			<li 
				v-if="DocumentVapp.type == 3 || DocumentVapp.type == 1"
				class="el-menu-item" 
				:class="{'is-active':LeftCurrenType=='tags'}"
				@click="LeftClick('tags')">
				<el-icon class="icon"><Collection-Tag /></el-icon>
				<el-text>标签管理</el-text>
				<span class="num">{{LeftTreeSidebar.tagnum}}</span>
			</li>
			<!-- <li 
				class="el-menu-item" 
				:class="{'is-active':LeftCurrenType=='member'}"
				@click="LeftClick('member')">
				<el-text>成员管理</el-text>
			</li> -->
			<li 
				v-if="DocumentVapp.type == 3"
				class="el-menu-item" 
				:class="{'is-active':LeftCurrenType=='recycle'}"
				@click="LeftClick('recycle')">
				<el-icon  class="icon"><Delete /></el-icon>
				<el-text>回收站</el-text>
				<span class="num">{{LeftTreeSidebar.isrecycle}}</span>
			</li>
		</ul>
		<div class="tree-tip">
			<el-button text  @click="LeftTree.Visible=!LeftTree.Visible" style="padding: 8px 6px;">
				<el-text type="info">
					分类
					<el-icon class="el-icon--right">
						<template v-if="LeftTree.Visible">
							<Caret-Bottom></Caret-Bottom>
						</template>
						<template v-else>
							<Caret-Right></Caret-Right>
						</template>
					</el-icon>
				</el-text>
				
			</el-button>
			<template v-if="DocumentVapp.type == 3">
				<el-button text icon="Plus" @click.stop="LeftTreeOperation('addparent')" style="padding: 6px;width: 32px;"></el-button>
			</template>
		</div>
		<div v-show="LeftTree.Visible" v-loading="LeftTree.loading" style="padding-right: 10px;">
			<el-tree
				v-if="LeftTree.show"
				ref="LeftTreeRef"
				lazy
				node-key="fid"
				@node-click="LeftTreeClick"
				@node-contextmenu="LeftTreeContextmenu"
				:load="LeftTreeGetFolder"
				:current-node-key="LeftTree.Currentkey"
				:expand-on-click-node="false"
				:default-expanded-keys="LeftTree.defaultOpenkeys"
				highlight-current
				icon="ArrowRight"
				:props="{label:'fname',children: 'children',isLeaf:'leaf'}">
				<template #default="{ node, data }">
				    <div class="custom-tree-node">
						<el-icon class="icon">
							<template v-if="node.expanded">
								<Folder-Opened />
							</template>
							<template v-else>
								<Folder />
							</template>
						</el-icon>
						<!-- <template v-if="node.data.isRename">
							<el-input 
								v-model.trim="data.fname" 
								size="small"
								:ref="'treeinput'+data.fid"
								maxlength="20" 
								placeholder="请输入"
								@keyup.enter.native="LefttreeinputRename" 
								@blur="LefttreeinputRename" />
						</template>
						<template v-else> -->
							<div class="name" :ref="'treename'+data.fid" v-cloak v-html="node.label"></div>
							<div class="num" v-if="node.expanded && parseInt(data.nosubfilenum)>0">{{data.nosubfilenum}}</div>
							<div class="num" v-if="!node.expanded && parseInt(data.filenum)>0">{{data.filenum}}</div>
						<!-- </template> -->
				    	
				    </div>
			  </template>
				
			</el-tree>
		</div>
	</el-scrollbar>
</div>

<div class="left-search">
	<el-input
		v-model="LeftTree.filterText" 
		placeholder="搜索分类"
		prefix-icon="Search"
		clearable
		@input="LeftClassifyFilterInput">
	</el-input>
</div>
<el-popover
	popper-class="isdropdown header-dropdown-menu"
	ref="treeMenu"
    v-model:visible="LeftTreePopover.show"
	:popper-style="{top: LeftTreePopover.top, left: LeftTreePopover.left}"
	trigger="contextmenu"
	width="auto"
	:show-arrow="false"
	@after-enter="handleDocumentOverlay(true)"
	@before-leave="handleDocumentOverlay(false)">
    <ul class="el-dropdown-menu">
		<li 
			class="el-dropdown-menu__item" 
			@click.stop="LeftTreeOperation('rename')">
			<el-icon><Edit-Pen /></el-icon>
			重命名
		</li>
		<el-divider style="margin: 4px 0;"></el-divider>
		<li
			class="el-dropdown-menu__item" 
			@click="LeftTreeOperation('addparent')">
			<el-icon><Folder-Add /></el-icon>
			新增同级文件夹
		</li>
		<li
			class="el-dropdown-menu__item" 
			@click="LeftTreeOperation('addchild')">
			<el-icon><Folder-Add /></el-icon>
			新增子级文件夹
		</li>
		<el-divider style="margin: 4px 0;"></el-divider>
		<li
			class="el-dropdown-menu__item" 
			@click="LeftTreeOperation('delete')">
			<el-icon><Delete /></el-icon>
			删除文件夹
		</li>
	</ul>
</el-popover>
<el-dialog
	custom-class="LeftTreeDialog"
    v-model="LeftTreeDialog.Visible"
    title="删除文件夹"
	:close-on-click-modal="false"
	:close-on-press-escape="false"
	:show-close="false"
    width="30%">
	<p>此操作无法恢复，确认要删除 " {{LeftTreeDialog.title}} " 文件夹吗？</p>
	 <el-checkbox v-model="LeftTreeDialog.checked" :true-label="1" :true-label="0" label="把文件夹内项目丢到回收站" ></el-checkbox>
    <template #footer>
      <span class="dialog-footer">
			<el-button @click="LeftTreeDialog.Visible = false" :disabled="LeftTreeDialog.loading">取消</el-button>
			<el-button type="primary" @click="LeftTreeDelete" :loading="LeftTreeDialog.loading">确定</el-button>
      </span>
    </template>
</el-dialog>
<el-dialog
    v-model="LeftTreeDialogAdd.Visible"
    :title="LeftTreeDialogAdd.title"
	:close-on-click-modal="false"
	:close-on-press-escape="false"
	:show-close="!LeftTreeDialogAdd.loading">
	<el-form>
		<el-form-item label="名称：">
			<div class="language-box">
				<el-input v-model="LeftTreeDialogAdd.name" clearable></el-input>
				<language v-if="LeftTreeDialogAdd.langkey" :langkey="LeftTreeDialogAdd.langkey" formhash="{FORMHASH}"></language>
			</div>
		  	
		</el-form-item>
	  	</el-form>
    <template #footer>
      <span class="dialog-footer">
			<el-button @click="LeftTreeDialogAdd.Visible = false" :disabled="LeftTreeDialogAdd.loading">取消</el-button>
			<el-button type="primary" @click="LeftTreeAdd" :loading="LeftTreeDialogAdd.loading">确定</el-button>
      </span>
    </template>
</el-dialog>
<div 
	@mousedown.prevent="LeftdragControllerDiv"
	:style="{position: 'absolute',height: '100%',width: '4px',top: '0',left: LeftWidth-2+'px',cursor: 'col-resize','z-index': 100}" 
	ref="leftResize" 
	id="leftResize"></div>
<div v-if="DocumentOverlay.left" class="el-overlay dzz-overlay" style="z-index: 1001;background: transparent;"></div>